<%@ page language="java" import="java.util.*,com.orderMgr.bean.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'FoodManagerList.jsp' starting page</title>
    
	  <script LANGUAGE="JavaScript">

    function del(){
        
        if(window.confirm("确实要删除吗？")){
     		return true;
        }else{
            return false;
        }
    }

</script>
    
  </head>
  
  <body bgcolor="#FAFBE7">
   <center>
   	<form action="" method="post">
				<div align="center">
				
				
				<table>
				<%
					
						List<OfFood> foods = (List<OfFood>)request.getAttribute("FoodList");
						for(int i = 0; i < foods.size(); i++){
							OfFood of = foods.get(i);
							if(i%4==0){
					%>		
				
				
					<tr>
					<%
							}else{ 
					%>	
			<td>
				<!-- DDTO 查询出数据库中的菜单 -->
				
				<table border="1" cellpadding="1" cellspacing="1" bordercolor="#FAE6CE">
					<tr><td rowspan="5" width="100pt" height="80">
					<img src="<%=basePath%>images/<%=of.getOfFoodPic()%>" width="200" height="250"/></td> 
					<td style="width: 120; height: 10">菜品ID: <%=of.getOfId() %></td></tr>
					<tr style="width: 40; height: 10"><td> 菜名: <%=of.getOfFoodName() %></td></tr>
					<tr style="width: 40; height: 10"><td>单价：<%=of.getOfFoodPrice() %></td></tr>
					<tr style="width: 40; height: 10"><td>餐馆ID: <%=of.getOfRestaurantId() %></td></tr>
					<tr style="width: 40; height: 10" align="center"><td><a href="deleteFood.action?ofId=<%=of.getOfId() %>" onclick="return del()">删除</a></td></tr>
				</table>
			</td>
			 			
					<%
							}
							if(i%4==3){
					%>
					 		</tr>
					<%	
					 		}
					 	}
					%>	
					
					
					</table>
					
				</div>
			</form>
   
   </center>
  </body>
</html>
